#lang web-server/insta

(struct post (title body))

(define BLOG
  (list (post "First Post" "This is my first post")
        (post "Second Post" "This is another post")))

(define (start request)
  (response/xexpr
   `(html (head (title "my blog"))
          (body (h1 "My blog")
                ,`(div ((class "posts"))
        ,@(map render-post BLOG))))))
 
(define (render-post a-post)
  `(div ((class "post"))
        ,(post-title a-post)
        (p, (post-body a-post))))